1. Field of the Invention
The present invention relates to an image data processing apparatus and method, and an image data processing program, and particularly, to an image data processing apparatus, method, and program for partitioning off data representing a particular image included in an image represented by given image data (hereinafter referred to as an input image) from the other portion (extracting data from the other portion) and outputting the data.
2. Description of the Background Art
An image represented by digital image data obtained by a digital camera is displayed on a display screen of a display device, or is printed on printing paper by a printer. A subject image is visibly displayed on the display screen or the printing paper. In order to reproduce (playback) the subject image displayed on the display screen or the printing paper more beautifully (or more faithfully), digital image data is subjected to white balance correction, gamma correction, and other corrections in a digital camera, a printer, a personal computer, etc.
Image data may, in some cases, be subjected to correction processing by paying attention to a particular image portion in the subject image. In a case where the face of a character is included in the subject image, for example, a white balance correction value, a gamma correction value, and correction values for the other corrections may, in some cases, be calculated using the face of the character in the subject image as an object such that the face of the character in the subject image is reproduced (displayed) more beautifully (or more faithfully).
In order to subject the image data to the correction processing by paying attention to the particular image portion in the subject image, the particular image portion must be detected (extracted) from the subject image. JP-A-11-316845 discloses that a plurality of subject extractions that differ in properties are performed, to synthesize subjects respectively extracted by the subject extractions, and subject extractions which differ in properties are further performed when the results of the synthesis do not satisfy the judgment criteria, to extract the main subject using the results.
In JP-A-11-316845, the results of the plurality of subject extractions are synthesized. When the results of the extraction that are incorrect (or inappropriate) are obtained, therefore, the results of the extraction are reflected on the extraction of the main subject. When image correction is made on the basis of the results of the extraction, the results of the image correction are also adversely affected.
As a method of distinguishing image data representing a particular image portion included in an image, for example, a face image portion of a character from the other image portion (an image portion other than the face image portion of the character) to extract (partition off) only the image data representing the face image portion, JP-A-9-101579 describes a method of extracting a face image portion utilizing color information. In JP-A-9-101579, it is judged whether or not the hue of each of pixels composing an image is included in a skin color range, to divide the original image into a skin color area and a non-skin color area. Further, an edge in the original image is detected, to classify the original image into an edge portion and a non-edge portion. An area positioned within the skin color area, composed of the pixels classified as the non-edge portion, and enclosed by the pixels judged as the edge portion is extracted as a face candidate area.
In the method of extracting the face image portion utilizing color information, judgment whether the color for each of the pixels composing the image is a color belonging to the skin color range greatly affects the precision of the extraction of the face image portion. In different subject images obtained by picking up the same subject under different light sources (e.g., a fluororescent light source, a tungsten light source, etc.), for example, therefore, the pixels (pixel ranges) that are judged to have the color belonging to the skin color range differ.
On the other hand, processing for detecting the particular image portion included in the image on the basis of the shape without using color information is previously performed, and processing for extracting the face image portion using a rectangular area including the detected particular image portion as a processing object is also considered. Since the processing for detecting the particular image portion is performed without using color information, the processing for extracting the face image portion that is hardly affected by the type of light source at the time of photographing.
In a method of extracting the face image portion included in the image on the premise that the processing for detecting the particular image portion on the basis of the shape, however, it is essential to the subsequent face image extraction processing that the face image portion is naturally detected. In face detection processing for a face image of a character, for example, if a front face is included in the image, the face image can be generally detected. When the face image is included in the image but is an image representing a side face, however, detection of the face image fails. Eventually, extraction of the face image may end in failure.